package sg.edu.nus.iss.vmcs.system;

/*
 * Copyright 2003 ISS.
 * The contents contained in this document may not be reproduced in any
 * form or by any means, without the written permission of ISS, other
 * than for the purpose for which it has been supplied.
 *
 */

import sg.edu.nus.iss.vmcs.store.*;

/**
 *
 *
 * @version 3.0 5/07/2003
 * @author Olivo Miotto, Pang Ping Li
 */

public class DrinkPropertyLoader extends PropertyLoader {

    public DrinkPropertyLoader() {
    }

    public void setImplementationType() {
        if (Environment.getImplementationType().equalsIgnoreCase("File")) {
            setPropertyLoaderImpl(new FilePropertyLoaderImpl(Environment.getDrinkPropFile())); // Environment.CASH_PROP_FILE
        } else if (Environment.getImplementationType().equalsIgnoreCase("Xml")) {
            setPropertyLoaderImpl(new XmlPropertyLoaderImpl(Environment.getDrinkPropXml()));// super.storeName
        }
    }

    public void saveProperty() throws Exception {
        getPropertyLoaderImpl().saveProperty();
    }

    public int getNumOfItems() {

        return getPropertyLoaderImpl().getNumOfItems();
    }

    public void setNumOfItems(int numItems) {

        getPropertyLoaderImpl().setNumOfItems(numItems);
    }

    public StoreItem getItem(int index) {

        return getPropertyLoaderImpl().getItem(index);
    }

    public void setItem(int index, StoreItem drinksItem) {
        getPropertyLoaderImpl().setItem(index, drinksItem);
    }
}
